<?php

use yii\helpers\Html;
//use yii\grid\GridView;
use kartik\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel common\models\CompanySearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Companies';
$this->params['breadcrumbs'][] = $this->title;
?>
<link rel="stylesheet" href="/static/css/gridview.css">
<div class="company-index" >
    <?php  echo $this->render('_search', ['model' => $searchModel]); ?>
    <?= GridView::widget([
     //   'containerOptions' => ['style' => 'height:500px;'], // only set when $responsive = false
        'headerRowOptions' => ['class' => 'kartik-sheet-style'],
        'filterRowOptions' => ['class' => 'kartik-sheet-style'],
        'dataProvider' => $dataProvider,
     //   'filterModel' => $searchModel,
       // 'pjax'=>true,
        'columns' => [
            /* ['class' => 'yii\grid\SerialColumn'], */

            'id',
            'company_name',
           
            'sort',
          //  'is_display',
            [
                'label'=>'是否显示',
                'attribute' => 'is_display',
                'value' => function ($model) {
                $state = [
                    '0' => '不显示',
                    '1' => '显示',
                ];
                return $state[$model->is_display];
                },
            ],
            
            'created_at:datetime',
            // 'updated_at',
            [
            'class' => 'yii\grid\CheckboxColumn',
            // you may configure additional properties here
            ],
            [
            'class' => 'yii\grid\ActionColumn',
            'template' => '{user-view} {user-update} {user-delete}',
            ],
            ['class' => 'yii\grid\ActionColumn'],
        ],
    ]); ?>
</div>
